-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for Account proofs blocks if they are not available yet #3159
Conversation
Added a comment, but generally looks good. |
4bea92c
to
b415376
Compare
d613688
to
220a6b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signing commit |
220a6b7
to
5720cf2
Compare
Wait for a set amount of events only Also continue with the next peer if it fails for the first peer instead of returning from the function.
5720cf2
to
3936e2f
Compare
Previously, the function would try to block the whole thread whenever requesting something from other peers. This wasn't noticed since the implementation is only used in light clients that were **NOT** compiled for WASM. I noticed this implementation when reviewing #3159, which would have caused these thread blockings to continue for longer times.
Previously, the function would try to block the whole thread whenever requesting something from other peers. This wasn't noticed since the implementation is only used in light clients that were **NOT** compiled for WASM. I noticed this implementation when reviewing #3159, which would have caused these thread blockings to continue for longer times.
Previously, the function would try to block the whole thread whenever requesting something from other peers. This wasn't noticed since the implementation is only used in light clients that were **NOT** compiled for WASM. I noticed this implementation when reviewing #3159, which would have caused these thread blockings to continue for longer times.
core-rs-albatross/web-client/src/client/lib.rs Lines 1177 to 1195 in c801676
|
Ah, stupid me. That while loop is for the tx listener, not for account proofs 👍 |
When getting the trie in the RemoteDataStore previous to this PR the block which is referenced by the returned proof must already exist locally. That is by no means guaranteed and will result in discarding the proof.
This PR thus added a waiting window within which the RemoteDataStore will wait for the block to arrive. It will wait a specified amount of blockchain events which have added blocks.
Additionally whenever a proof would not verify another peer will be asked to proof an address, whereas before this PR the get_trie would simply fail at this point.
A button was added to the web client example to exercise the behaviour.